<template>
	<view class="content">
	</view>
</template>

<script>
	import {jumpTypeEnum} from '@/common/const.js'
	export default {
		data() {
			return {
			}
		},
		onLoad(e) {
			this.init(e)
		},
		methods: {
			init(e){
				if(e.invitedCode){
					// 存在邀请码的场合
					this.$store.dispatch('setInvitedCode', {invitedCode: e.invitedCode})
				}
				
				if(e.registerType){
					// 存在邀请码的场合
					this.$store.dispatch('setRegisterType', {registerType: e.registerType})
				}
				
				this.$store.dispatch('getPlatform').then(res=>{
					if(e.type){
						if(e.type == 'home'){
							this.jumpUtil.jumpTo(jumpTypeEnum.switchTab, '/pages/home/index', false)
						} else if(e.type == 'article'){
							this.jumpUtil.jumpTo(jumpTypeEnum.switchTab, '/pages/article/index', false)
						} else if(e.type == 'goodsDetail'){
							let params = decodeURIComponent(e.params)
							console.log(e.type)
							console.log(params)
							this.jumpUtil.jumpTo(jumpTypeEnum.redirect, `/pages_one/goods/detail?${params}`, false)
						} else if(e.type == 'articleDetail'){
							let params = decodeURIComponent(e.params)
							console.log(e.type)
							console.log(params)
							this.jumpUtil.jumpTo(jumpTypeEnum.redirect, `/pages_one/article/detail?${params}`, false)
						}
					} else {
						this.jumpUtil.jumpTo(jumpTypeEnum.switchTab, '/pages/home/index', false)
					}
				})
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
